package com.ysstech.reportworld.service;

import com.ysstech.common.entity.TreeNode;
import com.ysstech.reportworld.entity.DataReport;
import com.ysstech.reportworld.entity.Report;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 报表世界报表信息 服务类
 * </p>
 *
 * @author lishuangliang
 * @since 2022-04-28
 */
public interface ReportService extends IService<Report> {
    /**
     * 查询报表信息
     *
     * @return
     */
    public List<TreeNode> queryReportTree() throws Exception;


    /**
     * 查询所有下级报表的报表集合
     *
     * @param id 报表编号
     * @return
     * @throws Exception
     */
    public List<Report> queryListReport(String id) throws Exception;


    /**
     * 查询所有下级报表的报表id集合
     *
     * @param id
     * @return
     * @throws Exception
     */
    public List<String> queryReportIds(String id) throws Exception;

    /**
     * 获取报表信息
     *
     * @return
     * @throws Exception
     */
    public Map<String, Report> getReportMap() throws Exception;


    /**
     * 添加模块信息
     *
     * @param report
     * @throws Exception
     */
    public void addReport(Report report) throws Exception;

    /**
     * 修改报表信息
     *
     * @param report
     * @throws Exception
     */
    public void editReport(Report report) throws Exception;

    /**
     * 删除报表信息
     *
     * @param id
     * @throws Exception
     */
    public void delReport(String id) throws Exception;

    /**
     * 通过报表的id 查询关联的表信息
     *
     * @param dataReport
     * @return
     */
    public List<DataReport> getTableInfo(DataReport dataReport) throws Exception;


    /**
     * 用过报表的结果集语句读取用到的表信息到库里
     *
     * @throws Exception
     */
    public void readTableInfo(String reportId) throws Exception;

    /**
     * 报表信息json
     */
    public String getReportJsonInfo() throws Exception;
}
